package models;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import play.db.jpa.Model;

/**
 * 实体类 - 新闻管理类
 * */
@Entity
@Table(name="news")
public class News extends Model{

	@ManyToOne
	@JoinColumn(name="man_id")
	public Managers managers;                          //管理员编号
	@Column(name="new_tit")
	public String newTit;                              //新闻标题
	@Column(name="new_det",columnDefinition="text")
	public String newDet;                              //新闻内容
	@Column(name="new_time")
	@Temporal(TemporalType.TIMESTAMP)
	public Date newTime;                               //发布时间
	@Column(name="new_hits")
	public int newHits;                                //点击量
	@Column(name="new_sta")
	public int newSta;                                 //状态
	@Column(name="new_sou")
	public String newSou;                              //来源
	@ManyToOne
	@JoinColumn(name="pro_id")
	public Programa programa;                          //栏目编号
	@Column(name="new_code")
	public String newCode;                             //新闻代码
	@Column(name="new_typ")
	public int newTyp;                                 //新闻类别
	@Column(name="new_kws")
	public String newKws;                              //关键字
	@Column(name="new_tag")
	public String newTag;                              //标签
	
	public String toString(){
		return newTit;
	}
}
